package com.my.study.designPatterns.compoundPattern;


public class YellowHeadDuck implements Quackable {


    private Observerable observerable;


    public YellowHeadDuck() {

        observerable = new Observerable(this);
    }

    @Override
    public void quack() {

        System.out.println("YellowHeadDuck quack");
        notifyObservers();
    }

    @Override
    public void registerObserver(DuckObserver observer) {

        observerable.registerObserver(observer);
    }

    @Override
    public void notifyObservers() {

        observerable.notifyObservers();
    }
}
